package 字符串;

import java.util.Scanner;

// 给定两个字符串，要求判断s2是否能被通过s1作循环位移得到的字符串包含
// s1 =AABCD 和 s2 =CDAA true
// s1 =ABCD  和 s2 =ACBD false
public class 旋转词 {
    public static void main(String[] args) {
        Scanner scanner =new Scanner(System.in);
        String s1 = scanner.next();
        String s2 = scanner.next();
        s1 = s1 + s1;
        if (pd(s1,s2)){
            System.out.println(true);
        }
        else {
            System.out.println(false);
        }
    }
    static boolean pd(String s1,String s2){
        int i = s1.indexOf(s2);
        if (i<0){
            return false;
        }
        else {
            return true;
        }
    }
}
